package cl.ncx.cmvrc.persistence.base.entities.personas;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;


/**
 * Persona entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "persona", schema = "base", uniqueConstraints = @UniqueConstraint(columnNames = "rut"))
@SequenceGenerator(name = "persona_seque", sequenceName = "base.persona_persona_id_seq")
public class Persona implements java.io.Serializable {

	private static final long serialVersionUID = -2048271020717293998L;

	private Integer personaId;
	private Integer rut;
	private String dv;
	private String nombres;
	private String apellidoPaterno;
	private String apellidoMaterno;	
	private String email;
	private String fono;

	// Constructors

	/** default constructor */
	public Persona() {
	}

	/** minimal constructor */
	public Persona(Integer personaId) {
		this.personaId = personaId;
	}

	/** full constructor */
	public Persona(Integer personaId, Integer rut, String dv, String nombres,
			String apellidoPaterno, String apellidoMaterno, Gruero gruero,
			String email, Cliente cliente, Autoridad autoridad,
			String fono) {
		this.personaId = personaId;
		this.rut = rut;
		this.dv = dv;
		this.nombres = nombres;
		this.apellidoPaterno = apellidoPaterno;
		this.apellidoMaterno = apellidoMaterno;
		this.email = email;
		this.fono = fono;
	}

	// Property accessors
	@Id
	@Column(name = "persona_id", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "persona_seque")
	public Integer getPersonaId() {
		return this.personaId;
	}

	public void setPersonaId(Integer personaId) {
		this.personaId = personaId;
	}

	@Column(name = "rut", unique = true)
	public Integer getRut() {
		return this.rut;
	}

	public void setRut(Integer rut) {
		this.rut = rut;
	}

	@Column(name = "dv", length = 1)
	public String getDv() {
		return this.dv;
	}

	public void setDv(String dv) {
		this.dv = dv;
	}

	@Column(name = "nombres")
	public String getNombres() {
		return this.nombres;
	}

	public void setNombres(String nombres) {
		this.nombres = nombres;
	}

	@Column(name = "apellido_paterno")
	public String getApellidoPaterno() {
		return this.apellidoPaterno;
	}

	public void setApellidoPaterno(String apellidoPaterno) {
		this.apellidoPaterno = apellidoPaterno;
	}

	@Column(name = "apellido_materno")
	public String getApellidoMaterno() {
		return this.apellidoMaterno;
	}

	public void setApellidoMaterno(String apellidoMaterno) {
		this.apellidoMaterno = apellidoMaterno;
	}

	@Column(name = "email")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "fono")
	public String getFono() {
		return this.fono;
	}

	public void setFono(String fono) {
		this.fono = fono;
	}

}